home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Glitch Apple Disk Collection
/
2014.glitch.apple.collection.zip
/
indexed
/
IFRSIM.DSK
/
CONWAY NDB.bas
< prev
next >
Wrap
BASIC Source File
|
2014-09-09
|
4KB
|
136 lines
5 REM COPYRIGHT 1982
6 REM BY VERNON BROWN AND
7 REM PROGRAMAMERS SOFTWARE
9 REM
10 REM ***********************
11 REM * CONWAY NDB BUILT *
12 REM * FROM SEED *
13 REM * *
14 REM * USED TO CREATE NEW *
15 REM * IFR SITUATIONS FOR *
16 REM * PROGRAMMERS FLIGHT *
17 REM * SIMULATOR *
18 REM ***********************
19 REM
20 S = 100:S1 = 0:UP = 24579
70 ST = 24576:O1 = ST +56:O2 = ST +58:I1 = ST +60:I2 = ST +61:MA = ST +12:X1 = ST +26:Y1 = ST +28:AL = ST +87
120 SH = ST +09:PL = ST +06:LI = ST +15:XY = ST +18:DF = ST +39:CH = ST +93:WS = ST +42:WW = ST +43:WN = ST +44:WE = ST +45
170 REM
220 REM PX=PICTURE OFFSET
221 REM XL=POINTER LOW BYTE
222 REM XH=POINTER HIGH BYTE
223 REM XX=DOIT FLAG
270 REM
320 PX = 27388:XL = 27389:XH = 27390:XX = 27391: POKE PX,00: POKE XL,00: POKE XH,72: POKE XX,00
370 REM
420 REM
470 XC = 100:YC = 100:XF = 100:YF = 100:TX = 100:TY = 100
520 TEXT : GOSUB 5570
570 MT = 15:GAS = 0:MI = 0:SE = 0:S1 = 0
620 REM
670 REM SET UP WIND DRIFT
720 REM
770 POKE WN,0: POKE WE,0: POKE WS,0: POKE WW,0
820 A% = RND(1) *4:B% = RND(1) *50
870 ON A% GOTO 920,970,1020,1070
920 POKE WN,B%: GOTO 1120
970 POKE WE,B%: GOTO 1120
1020 POKE WS,B%: GOTO 1120
1070 POKE WW,B%: GOTO 1120
1120 CALL ST
1170 POKE O1,32: POKE O2,32: POKE I1,48: POKE I2,48
1220 REM
1270 REM
1320 REM OMNI MESSAGE AND
1370 REM STARTING X Y CORD
1420 REM
1470 VTAB 22: REM OMNI MESSAGE
1520 POKE X1,90: POKE Y1,90
1570 REM
1620 REM STARTING ALTITUDE
1670 REM
1720 POKE AL,16: POKE AL -3,32:MA% = 7
1770 REM
1820 REM
1870 CALL UP
1920 S1 = S1 +1: IF S1 >S THEN 2170
1970 GOTO 1870
2020 REM
2070 REM UPDATE THE CLOCK
2120 REM
2170 S1 = 0:SE = SE +1: IF SE <60 THEN 2320
2220 SE = 0:MI = MI +1:GA = GA +1: IF GA = MT THEN 4870
2270 CALL UP
2320 HTAB 1: VTAB 24: PRINT HO;":";MI;":";SE;" ";: CALL UP
2370 REM
2420 REM MOVE THE PICTURE
2470 REM
2520 REM
2570 REM DO THE ADF AND OMNI
2620 REM
2670 X = PEEK(X1):Y = PEEK(Y1)
2720 IX = XF -X:IY = YF -Y:DY = X -Y:DX = XC -X
2770 MV% = (TX -X) *4: IF MV% < -20 OR MV% >20 THEN MV% = 40
2820 IF MV% <0 THEN MV% = 80 +MV%
2870 IF TY -Y < -20 OR TY -Y >20 THEN MV% = 40
2920 REM
2970 REM DO THE ADF
3020 REM
3070 CALL UP
3120 IF IX = 0 THEN 3220
3170 IT = IY/IX
3220 T1 = ATN(IT)
3270 T1% = 16 -10 *T1
3320 IF X >XF THEN PF% = (176 -T1%) - PEEK(CH)
3370 IF X <XF THEN PF% = (208 -T1%) - PEEK(CH)
3420 IF PF% >64 THEN PF% = PF% -64: GOTO 3420
3470 POKE DF,PF%
3520 REM
3570 REM DO THE OMNI
3620 REM
3670 CALL UP
3720 IF DY < -5 THEN DY = -6
3770 IF DY >5 THEN DY = 6
3820 IF DX < -5 THEN DX = -6
3870 IF DX >5 THEN DX = 6
3920 IF DI >5 THEN DI = 6
3970 IF DI < -5 THEN DI = -6
4020 POKE O1,32 -DX: POKE I1,48
4070 POKE O2,32 -DX: POKE I2,48
4120 REM
4170 REM DO THE GLIDE SLOPE
4220 REM
4270 CALL UP
4320 IF PEEK(ALT) <MA% THEN 4870
4370 SL = X -66:DI = PEEK(ALT) *70 -SL
4420 IF DI >5 THEN DI = 6
4470 IF DI < -5 THEN DI = -6
4520 IF SL >40 THEN 4670
4570 IF SL < -10 THEN 4670
4620 POKE I2,48
4670 IF PEEK(AL) >2 THEN 1870
4720 REM
4770 REM DO THE AIRPORT
4820 REM
4870 POKE PX,MV%: POKE XX,00: CALL UP: CALL UP: POKE XX,01: FOR I = 0 TO 391: CALL UP: NEXT : PRINT : PRINT "PUSH ANY KEY TO CONTINUE"
4880 POKE XX,00
4920 GET A$
4970 REM FIRST THE FLIGHT PATH
5020 HGR : HCOLOR= 3: CALL 24588
5030 HPLOT 90,100: HPLOT TO 100,100
5040 HPLOT 95,100: HPLOT TO 95,105
5070 REM
5120 REM THEN THE NAV TRACK
5170 REM
5220 FOR X = 105 TO 250 STEP 4
5230 Y = 50 +X/2: HPLOT X,Y
5240 NEXT
5270 HOME : VTAB 23: PRINT "PUSH RETURN TO FLY THIS AGAIN": PRINT "ANY OTHER KEY WILL GO BACK TO MENU": GET A$
5320 IF ASC(A$) = 13 THEN 520
5370 PRINT CHR$(4)
5420 PRINT CHR$(4);"RUN MENU"
5470 END
5520 REM
5570 TEXT : HOME : PRINT "YOU ARE CLEARED"
5580 PRINT : PRINT "FOR THE CONWAY NDB APPROACH": PRINT : PRINT "VOR IS SET TO LIT 328 DEGREES FROM"
5620 PRINT : PRINT "HIT ANY KEY WHEN READY TO FLY": GET A$: HOME : RETURN